From 7b37f67b57515969ac0b3861484babe1d42a5845 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sun, 30 May 1993 18:12:11 +0000 Subject: [PATCH] * xfaces.c (init_frame_faces): We have to make sure that face ID's are valid on all frames or no frames; make sure F has allocated faces for any face valid on the selected frame. --- src/xfaces.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/xfaces.c b/src/xfaces.c index d7594a051e0..4e4d4699990 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -90,7 +90,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ vector). These are called "frame faces". Element 0 is the default face --- the one used for normal text. Element 1 is the modeline face. - These faces have their GC's set; the rest do not. (See src/xterm.h.) + These faces have their GC's set; the rest do not. + If faces[i] is filled in (i.e. non-zero) on one frame, then it must + be filled in on all frames. Code assumes that face ID's can be + used on any frame. (See src/xterm.h.) The global variables `face_vector' and `nfaces' define another array of struct face pointers, with their GC's set. This array @@ -457,6 +460,22 @@ init_frame_faces (f) ensure_face_ready (f, 1); recompute_basic_faces (f); + + /* Supposedly, we only apply this function to newly-created frames. */ + if (selected_frame == f) + abort (); + + /* Make sure that all faces valid on the selected frame are also valid + on this new frame. */ + { + int i; + int n_faces = selected_frame->display.x->n_faces; + struct face **faces = selected_frame->display.x->faces; + + for (i = 2; i < n_faces; i++) + if (faces[i]) + ensure_face_ready (f, i); + } } -- 2.30.2